home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xfig.idb / usr / freeware / src / xfig / transfig.3.1.2 / fig2dev / fig2dev.h.z / fig2dev.h
Encoding:
C/C++ Source or Header  |  1997-09-09  |  3.0 KB  |  114 lines

  1. /*
  2.  * TransFig: Facility for Translating Fig code
  3.  * Copyright (c) 1985 Supoj Sutantavibul
  4.  * Copyright (c) 1991 Micah Beck
  5.  *
  6.  * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  7.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  8.  * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  9.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  10.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  11.  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  12.  * PERFORMANCE OF THIS SOFTWARE.
  13.  *
  14.  * The X Consortium, and any party obtaining a copy of these files from
  15.  * the X Consortium, directly or indirectly, is granted, free of charge, a
  16.  * full and unrestricted irrevocable, world-wide, paid up, royalty-free,
  17.  * nonexclusive right and license to deal in this software and
  18.  * documentation files (the "Software"), including without limitation the
  19.  * rights to use, copy, modify, merge, publish, distribute, sublicense,
  20.  * and/or sell copies of the Software, and to permit persons who receive
  21.  * copies from any such party to do so, with the only requirement being
  22.  * that this copyright notice remain intact.  This license includes without
  23.  * limitation a license to do the foregoing actions under any patents of
  24.  * the party supplying this software to the X Consortium.
  25.  */
  26.  
  27. typedef char Boolean;
  28. #define    NO    2
  29. #define    FALSE    0
  30. #define    TRUE    1
  31.  
  32. #define DEFAULT_FONT_SIZE 11
  33.  
  34. #if defined(SYSV) || defined(SVR4)
  35. #include <string.h>
  36. #else
  37. #include <strings.h>
  38. #ifndef strchr
  39. extern char *strchr();
  40. #endif
  41. #ifndef NeXT
  42. #define    strchr    index
  43. #define    strrchr    rindex
  44. #endif
  45. #endif
  46.  
  47. extern    double    atof();
  48.  
  49. #define round(x)    ((int) ((x) + ((x >= 0)? 0.5: -0.5)))
  50.  
  51. #define    NUM_STD_COLS    32
  52. #define    MAX_USR_COLS    512
  53.  
  54. #define NUMSHADES    21
  55. #define NUMTINTS    20
  56. #define NUMPATTERNS     22
  57.  
  58. /* 
  59.  * Device driver interface structure
  60.  */
  61. struct driver {
  62.      void (*option)();    /* interpret driver-specific options */
  63.       void (*start)();    /* output file header */
  64.     void (*arc)();        /* object generators */
  65.     void (*ellipse)();
  66.     void (*line)();
  67.     void (*spline)();
  68.     void (*text)();
  69.     void (*end)();        /* output file trailer */
  70.       int text_include;    /* include text length in bounding box */
  71. #define INCLUDE_TEXT 1
  72. #define EXCLUDE_TEXT 0
  73. };
  74.  
  75. extern char Err_badarg[];
  76. extern char Err_incomp[];
  77. extern char Err_mem[];
  78.  
  79. extern char *PSfontnames[];
  80.  
  81. extern int   PSisomap[];
  82.  
  83. extern char    *prog, *from;
  84. extern char    *name;
  85. extern int    font_size;
  86. extern double    mag;
  87. extern FILE    *tfp;
  88.  
  89. extern int    llx, lly, urx, ury;
  90. extern int    landscape;
  91. extern int    center;
  92. extern int    orientspec;    /* true of the command-line args specified land or port */
  93.  
  94. /* user-defined colors */
  95. typedef        struct{
  96.             int c,r,g,b;
  97.             }
  98.         User_color;
  99.  
  100. extern User_color    user_colors[MAX_USR_COLS];
  101. extern int        user_col_indx[MAX_USR_COLS];
  102. extern int        num_usr_cols;
  103. extern Boolean        pats_used, pattern_used[NUMPATTERNS];
  104.  
  105. extern void gendev_null();
  106.  
  107. /* for GIF files */
  108. #define    MAXCOLORMAPSIZE 256
  109.  
  110. struct Cmap {
  111.     unsigned short red, green, blue;
  112.     unsigned long pixel;
  113. };
  114.